package com.bsoft.ecommerce.coverter;
//商品类别

import com.bsoft.ecommerce.constant.GoodsCategory;
import org.apache.kafka.common.protocol.types.Field;

import javax.persistence.AttributeConverter;

public class GoodsCategoryCoverter  implements AttributeConverter<GoodsCategory, String> {


    @Override
    public String convertToDatabaseColumn(GoodsCategory goodsCategory) {
        return goodsCategory.getCode();
    }

    @Override
    public GoodsCategory convertToEntityAttribute(String s) {
        return GoodsCategory.of(s);
    }
}
